#ifndef CARDPANEL_H
#define CARDPANEL_H

#include <QWidget>
#include <QPixmap>
#include "player.h"
#include <card.h>

class CardPanel : public QWidget
{
    Q_OBJECT
public:
    explicit CardPanel(QWidget *parent = nullptr);
    // 获取 图片参数
    void setImage(QPixmap &font, QPixmap &back);
    QPixmap getimage();
    // 扑克牌 显示的那一面
    void setFrontSize(bool flag);
    bool isFrontSide();

    // 记录窗口是否被选中了
    void setSeclected(bool flag);
    bool isSelected();



    // 扑克牌的花色 以及 点数
    void setCard(Card& card);
    void getCard();

    //扑克牌所有者
    void setOwner(Player* player);
    Player* getOwner();


protected:
    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);
private:
    QPixmap m_front;
    QPixmap m_back;
    bool m_isfront;
    Player* m_owner;
    Card m_card;
    bool m_isSelect = false;


signals:

public slots:
};

#endif // CARDPANEL_H
